#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <connection.h>
#include <video.h>
#include <QCamera>
#include <QGraphicsView>
#include <QCameraImageCapture>

//**************************************************************
//
//                    CAM SCANNER - PROJECT
//
// This is the main class.
//
// version 1.0 - 25.06.2012 Adriano:
//    : first version
//
//
//
//
//
//
//
//**************************************************************

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    enum ScreenOrientation {
        ScreenOrientationLockPortrait,
        ScreenOrientationLockLandscape,
        ScreenOrientationAuto
    };

    explicit MainWindow(QWidget *parent = 0);
    virtual ~MainWindow();

    // Note that this will only have an effect on Symbian and Fremantle.
    void setOrientation(ScreenOrientation orientation);

    void showExpanded();

private slots:
        // button: TAKE PHOTO
    void on_pushButton_photo_clicked();

        // button: EXIT APP
    void on_pushButton_exit_clicked();

        // WiFi connected, the signal is in connection.h
    void WiFiConnected();

        // Image captured, preview from QCamera signal
    void imageCaptured(int,QImage);
        // Image saved, image saved from QCamera signal
    void imageSaved(int,QString);

        // QCamera has a new state
    void cameraStateChanged(QCamera::State);

        // Focus camera, signal is emitted from button
    void on_pushButton_focus_clicked();

private:
    Ui::MainWindow*         ui;                 // form UI

    connection*             m_netConnection;    // connection class, wifi-functions
    videoView*              m_view;             // view object for camera
    QCamera*                m_camera;           // camera object, fot taking photos
    QCameraImageCapture*    m_previewCapture;   // camera information/configuration object

    QImage                  m_im2;              // image. This image will be sent to the server.
};

#endif // MAINWINDOW_H
